<?php
	include "lib/lib.main.php";
	print_header("Login overview");
	$logins = $db->q("table SELECT Login, Timestamp, IP FROM Logins LEFT JOIN Users ON Logins.UserID = Users.ID ORDER BY Timestamp DESC LIMIT 0, 50");
	print "<h1>Recent logins</h1>";
	print "<table class='center'><tr class='gray' style='text-align: left;'><th>Timestamp</th><th>User</th><th>IP</th></tr>";
	foreach($logins as $l) {
		print "<tr" . ($i++ % 2 ? " class='gray'" : "") . "><td>{$l['Timestamp']}</td><td>{$l['Login']}</td><td>" . substr($l['IP'], 0, 5) . "...</td></tr>";
	}
	print "<tr><td colspan='3' class='hint'>The data in the table are for statistical purposes only. They will not be used to extract personal information.</td></tr>";
	print "</table>";
	print_footer();
?>
